﻿//Date Helper  
//author: Alexis 2011-06-25
//blog: http://www.cnblogs.com/alexis/

using System;
using System.Net;

namespace AccountHelper.Common
{
    public static class DateHelper
    {
        /// <summary>
        /// 获取时间的月份，如2011-5-22日则返回May
        /// </summary>
        /// <param name="date"></param>
        /// <returns></returns>
        public static string GetShortMonth(DateTime date)
        {
            return date.ToString("MMM", new System.Globalization.CultureInfo("en-US"));
        }

        /// <summary>
        /// 获取时间的当前月天数，如2011-5-22日则返回05
        /// </summary>
        /// <param name="date"></param>
        /// <returns></returns>
        public static string GetShortDate(DateTime date)
        {
            return date.ToString("dd", new System.Globalization.CultureInfo("en-US"));
        }

        public static string GetYearMonth(DateTime date)
        {
            return date.ToString("yyyy-MMM", new System.Globalization.CultureInfo("en-US"));
        }

        
    }
}
